//****************************************************
// Porman Project 2
// Filename: CWinClass.h
// Date: 2009/08/15
// Author: KengYu Lin
// Modify:
//****************************************************
#ifndef _WINCLASS_
#define _WINCLASS_

#include <windows.h> // Header File For Windows

class CWinClass
{
public:
    CWinClass( void );
    virtual ~CWinClass( void ) {}

    bool create( CHAR* Title, int iWidth, int iHeight, int iBits, bool bFullscreen );
    virtual int run( void );
    void kill( void );

    static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );

public:
    virtual bool initialGL( void ) = 0;
    virtual void resizeGL( int iWidth, int iHeight ) = 0;
    virtual void updateGL( void ) = 0;
    virtual void swapGL( void ) = 0;
    virtual void drawGL( void ) = 0;
    virtual void killGL( void ) = 0;

protected:
    virtual LRESULT CALLBACK _processWndProce( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) = 0;

    HWND      m_hWnd;
    HINSTANCE m_hInstance;
    bool      m_bFullscreen;
    int m_iW, m_iH;

    int m_iFPS;
    float m_fFramesPerSecond;
    float m_fLastTime;
};

#endif